package com.ssm.studen.controller;

import com.ssm.studen.model.Permission;
import com.ssm.studen.service.PermissionService;
import com.ssm.studen.tool.ResponseMessage;
import com.ssm.studen.tool.Result;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * 权限表：
 *      对外提供数据服务接口
 */
@Api(tags = "permission")
@RestController
public class PermissionController {

    @Autowired
    private PermissionService permissionService;


    /********************权限表查询**********************/
    @ApiOperation("权限表查询")
    @RequestMapping(value = "/selectPermission",method = RequestMethod.PUT)
    public ResponseMessage selectPermission(int psnum){
        Map<String,List> map = new HashMap<>();
        List<Permission> listPermission = permissionService.selectPermission(psnum);
        map.put("list",listPermission);
        return Result.success("200",map);
    }
}
